package com.kaili.basic.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.kaili.basic.pojo.dto.DeviceDTO;
import com.kaili.basic.pojo.dto.DeviceSumDTO;
import com.kaili.basic.pojo.entity.DeviceEntity;
import com.kaili.basic.pojo.entity.DeviceSignEntity;
import com.kaili.basic.pojo.vo.DeviceSignVO;
import com.kaili.basic.pojo.vo.DeviceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
*  mapper
* @author:zhouyijian
* @Time: 2019-07-24
* @Copyright: ©  杭州凯立通信有限公司 版权所有
* @Warning: 本内容仅限于公司内部传阅,禁止外泄或用于其它商业目的
*/
@Mapper
public interface DeviceMapper extends BaseMapper<DeviceEntity> {

    /**
     * @Desc: 根据imei获取设备状态
     * @author:zhouyijian
     * @time: 2019/7/25 11:09
     * @param imei
     * @return: DeviceEntity
     */
    DeviceEntity getIsActionByImei(String imei);

    /**根据条件查询设备信息
     * @Desc:
     * @author:zhouyijian
     * @time: 2019/7/25 11:10
     * @param entity
     * @return: List<DeviceVO>
     */
    List<DeviceVO> queryPageList(DeviceEntity entity);
    /**
     * @Desc:查询设备是否存在
     * @author:zhouyijian
     * @time: 2019/7/25 16:20
     * @param map
     * @return: boolean
     */
    DeviceVO validateIsExistByImei(Map<String,Object> map);

    /**
     * @Desc:查询未签到的设备信息
     * @author:zhouyijian
     * @time: 2019/7/26 18:32
     * @param entity
     * @return: List<DeviceSignVO>
     */
    List<DeviceSignVO> queryUnSignDetail(DeviceEntity entity);


    /**
     * @Desc:查询设备型号
     * @author:zhouyijian
     * @time: 2019/7/30 17:28
     * @return: List<java.lang.String>
     */
    List<DeviceVO> queryModelByTypeId(Integer typeId);

    /**
     * @Desc:获取设备登记总数
     * @author:zhouyijian
     * @time: 2019/8/1 10:11
     * @return: java.lang.Integer
     */
    Integer getDeviceTotal();
    DeviceEntity getDeviceByImei(String imei);

    /**
     * @Desc:脱离管控设备数
     * @author:zhouyijian
     * @time: 2019/8/1 13:30
     * @return: java.lang.Integer
     */
    Integer getDeviceOutController(DeviceSumDTO dto);

    /**
     * @Desc:告警设备
     * @author:zhouyijian
     * @time: 2019/8/1 15:30
     * @return: java.lang.Integer
     */
    Integer getDeviceWarnTotal();
    DeviceEntity getDeviceBySn(String imei);
}
